home *** CD-ROM | disk | FTP | other *** search
/ Language/OS - Multiplatform Resource Library / LANGUAGE OS.iso / smaltalk / gnu_st.lha / gnu_st / smalltalk-1.1.1 / stix / Drawable.st < prev    next >
Text File  |  1991-09-12  |  2KB  |  68 lines

  1. "======================================================================
  2. |
  3. | Copyright (C) 1990, 1991 Free Software Foundation, Inc.
  4. | Written by Steve Byrne.
  5. |
  6. | This file is part of GNU Smalltalk.
  7. |
  8. | GNU Smalltalk is free software; you can redistribute it and/or modify it
  9. | under the terms of the GNU General Public License as published by the Free
  10. | Software Foundation; either version 1, or (at your option) any later version.
  11. | GNU Smalltalk is distributed in the hope that it will be useful, but WITHOUT
  12. | ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
  13. | FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
  14. | details.
  15. | You should have received a copy of the GNU General Public License along with
  16. | GNU Smalltalk; see the file COPYING.  If not, write to the Free Software
  17. | Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.  
  18. |
  19.  ======================================================================"
  20.  
  21.  
  22. "
  23. |     Change Log
  24. | ============================================================================
  25. | Author       Date       Change 
  26. | sbyrne     24 May 90      created.
  27. |
  28. "
  29.  
  30.  
  31. Object subclass: #Drawable
  32.        instanceVariableNames: 'display id'
  33.        classVariableNames: ''
  34.        poolDictionaries: 'XGlobals'
  35.        category: 'X hacking'
  36. !
  37.  
  38. Object subclass: #GC        "should this be folded into some higher level class?"
  39.        instanceVariableNames: 'display drawable id'
  40.        classVariableNames: ''
  41.        poolDictionaries: 'XGlobals'
  42.        category: 'X hacking'
  43. !
  44.  
  45. !Drawable methodsFor: 'X hacking'!
  46.  
  47. createGC: aBlock
  48.     | packet gc |
  49.     
  50.     packet _ XGCAttrPacket command: 55.
  51.  
  52.     gc _ GC new: display drawable: self.
  53.     packet long: gc id; long: self id.
  54.     aBlock notNil
  55.     ifTrue: [ aBlock value: packet ]
  56.     ifFalse: [ packet noBits ].
  57.     
  58.     
  59.     display socket bytes: packet done.
  60.     ^gc
  61. !
  62.  
  63. id
  64.     ^id
  65. !!
  66.